package la.iok.hzsvn.lewin.movie.core.operation.param;

import java.util.Objects;

import static la.iok.hzsvn.lewin.movie.core.operation.model.ChargeOrderBase.PAY_TYPE_ADMIN;
import static la.iok.hzsvn.lewin.movie.core.operation.model.ChargeOrderBase.PAY_TYPE_ALIPAY;

public class ChargeOrderBaseParam {
    /**
     * 充值金额,单位为分
     */
    private Integer amount;
    /**
     * 支付方式,1:微信;2:支付宝
     */
    private Integer payType;

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public boolean payTypeAdmin(){
        return payType == PAY_TYPE_ADMIN;
    }

    public boolean payTypeAli(){
        return payType == PAY_TYPE_ALIPAY;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ChargeOrderBaseParam)) return false;
        ChargeOrderBaseParam that = (ChargeOrderBaseParam) o;
        return Objects.equals(amount, that.amount) && Objects.equals(payType, that.payType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(amount, payType);
    }
}
